﻿<UserControl x:Class="ControlerLib.SlimDxControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="426" d:DesignWidth="354" xmlns:my="clr-namespace:ControlerLib">
    <Control.Resources>
        <Style x:Key="MyFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Control}">
                        <Grid Margin="3 2">
                            <Rectangle Name="r1" StrokeThickness="1" Stroke="Black" StrokeDashArray="2 2"/>
                            <Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"  CornerRadius="2" BorderThickness="1" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <Style x:Key="ShadowStyle">
            <Setter Property="Control.Foreground" Value="LightGray" />
        </Style>

        <Style x:Key="InformButton" TargetType="Button">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Margin" Value="2"/>
            <Setter Property="FontFamily" Value="Verdana"/>
            <Setter Property="FontSize" Value="11px"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}" />

            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">

                        <Border Name="border" 
				BorderThickness="1"
				Padding="4,2" 
				BorderBrush="DarkGray" 
				CornerRadius="3" 
                                    MinHeight="16"
                                    MinWidth="16"
                                    MaxHeight="64"
                                    MaxWidth="64"
                                    
				Background="{TemplateBinding Background}">
                            <Grid>
                                <ContentPresenter HorizontalAlignment="Center" 
                                                      
	                           VerticalAlignment="Center" Name="contentShadow" 
					Style="{StaticResource ShadowStyle}">
                                    <ContentPresenter.RenderTransform>
                                        <TranslateTransform X="1.0" Y="1.0" />
                                    </ContentPresenter.RenderTransform>
                                </ContentPresenter>
                                <ContentPresenter HorizontalAlignment="Center" 
                            VerticalAlignment="Center" Name="content"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="border" Property="BorderBrush" Value="Orange" />

                                <Setter Property="Foreground" Value="SlateBlue" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">

                            </Trigger>
                            <Trigger Property="IsDefaulted" Value="True">
                                <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
                            </Trigger>
                            <Trigger Property="IsFocused" Value="True">
                                <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="border" Property="Opacity" Value="0.7" />
                                <Setter Property="Foreground" Value="Gray" />
                            </Trigger>

                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Control.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="200*" Name="GridFirst" />
            <RowDefinition Height="30*" />
            <RowDefinition Height="40*" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="10*" />
                <ColumnDefinition Width="100*" />
                <ColumnDefinition Width="10*" />
                <ColumnDefinition Width="10*" />
            </Grid.ColumnDefinitions>
            <Border Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="MyBorder">
                
            </Border>
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="32*" />
                    <RowDefinition Height="32*" />
                    <RowDefinition Height="32*" />
                    <RowDefinition Height="272*" />
                </Grid.RowDefinitions>
                <Button Grid.Row="0" Style="{DynamicResource InformButton}" Name="buttonIconStartFile" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" BorderBrush="{x:Null}" Foreground="{x:Null}" DataContext="{Binding}" Click="buttonIconStartFile_Click">
                    <Button.Background>
                        <ImageBrush RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/startfile64.png" />
                    </Button.Background>
                </Button>
                <Button Grid.Row="1" Style="{DynamicResource InformButton}" Name="buttonIconStopFile" BorderBrush="{x:Null}" Foreground="{x:Null}" DataContext="{Binding}" Click="buttonIconStopFile_Click" Margin="2">
                    <Button.Background>
                        <ImageBrush RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/stopfile64.png" />
                    </Button.Background>
                </Button>
                <Button Grid.Row="2" Style="{DynamicResource InformButton}" Name="buttonIconResumeFile" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" BorderBrush="{x:Null}" Foreground="{x:Null}" DataContext="{Binding}" Click="buttonIconResumeFile_Click">
                    <Button.Background>
                        <ImageBrush RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/pausefile64.png" />
                    </Button.Background>
                </Button>
            </Grid>
            <WindowsFormsHost Grid.Column="1" Grid.Row="0" Width="{Binding ElementName=MyBorder, Path=ActualHeight}" Name="host" VerticalAlignment="Stretch" Loaded="host_Loaded"/>
            <my:ColorScaleViewer Grid.Column="3" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="colorScaleViewer1"/>
        </Grid>
        <my:SimpleGraph Grid.Row="1"  x:Name="simpleGraph1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Loaded="simpleGraph1_Loaded" />
        <Grid Grid.Row="2" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="90*" />
                <ColumnDefinition Width="133*" />
                <ColumnDefinition Width="131*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="100*" />
                <RowDefinition Height="100*" />
                <RowDefinition Height="100*" />
            </Grid.RowDefinitions>
            <Button Grid.Column="0" Grid.Row="0" Content="Set Ref"  HorizontalAlignment="Stretch" Name="buttonSetRef" VerticalAlignment="Stretch"  Click="buttonSetRef_Click" />
            <Button Grid.Column="0" Grid.Row="1" Content="Tank"  HorizontalAlignment="Stretch" Name="buttonTankMesh" VerticalAlignment="Stretch"  Click="buttonTankMesh_Click"  />
            <Button Grid.Column="0" Grid.Row="2"  Content="Human"  HorizontalAlignment="Stretch" Name="buttonHumanMesh" VerticalAlignment="Stretch"  Click="buttonHumanMesh_Click"  />

            <Button Grid.Column="1" Grid.Row="0" Content="Reset Thresholds"  HorizontalAlignment="Stretch" Name="buttonResetThreshold" VerticalAlignment="Stretch"  Click="buttonResetThreshold_Click"  />
            <Button Grid.Column="1" Grid.Row="1" Content="+ threshold"  HorizontalAlignment="Stretch" Name="buttonPlusTheshold" VerticalAlignment="Stretch"  Click="buttonPlusTheshold_Click"  />
            <Button Grid.Column="1" Grid.Row="2" Content="- threshold" HorizontalAlignment="Stretch" Name="buttonMinusThreshold" VerticalAlignment="Stretch"  Click="buttonMinusThreshold_Click" />

            <Button Grid.Column="2" Grid.Row="0" Content="Auto Scale"  HorizontalAlignment="Stretch" Name="button1" VerticalAlignment="Stretch" Click="button1_Click"  />
            <Button Grid.Column="2" Grid.Row="2" Content="Do Movie" HorizontalAlignment="Stretch" Name="buttonDoMovie" VerticalAlignment="Stretch"  Click="buttonDoMovie_Click"  />
        </Grid>
        
    </Grid>
</UserControl>
